<template>
  <h1>{{ o }}</h1>
  <button @click='setF'>点击</button>
</template>
<!-- // setup作为script的属性 是 setup函数的语法糖 -->
<script setup>
import { reactive, toRef , ref , toRefs } from "vue";
  const o = reactive({
    uname:"张三",
    age:18
  })
  // toRefs把所有的属性都变成响应式数据;
  const  res = {...toRefs(o)}
  let setF = ()=>{
    console.log(res.age.value++);
  }
</script>
<script>
// 新创建script标签 用于写入name属性;
  export default {
    name:"App"
  }
</script>
